package com.yunxi.service.localService.impl.otd;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.page.PageHelperPlus;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.dao.otd.OtdIfProducePlanMapper;
import com.yunxi.model.otd.OtdIfProducePlan;
import com.yunxi.otd.pojo.OtdIfProducePlanVO;
import com.yunxi.service.localService.otd.OtdIfProducePlanService;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 生产计划 服务实现类
 * </p>
 *
 * @author XUQI
 * @since 2019-05-24
 */
@Service
public class OtdIfProducePlanServiceImpl extends ServiceImplPlus<OtdIfProducePlanMapper, OtdIfProducePlan> implements
    OtdIfProducePlanService {

    @Override
    public List<Map<String, Object>> findDailyByCode(String year, String month, String modelCode,
        List<Integer> dayList) {
        return baseMapper.selectDailyByCode(year, month, modelCode, dayList);
    }

    @Override
    public PageInfo findChangePlan(OtdIfProducePlanVO planVO, Integer pageNum, Integer pageSize) {
        Map map = BeanTools.bean2map(planVO);
        PageHelperPlus.startPage(pageNum,pageSize);
        List<Object> list = baseMapper.selectChangePlan(map);
        PageInfo<Object> pageInfo = new PageInfo<Object>(list);
        return pageInfo;
    }

    @Override
    public OtdIfProducePlanVO findVOByCode(String planNo) {
        return baseMapper.selectVOByCode(planNo);
    }

    @Override
    public OtdIfProducePlan findByCode(String planNo) {
        return baseMapper.selectByCode(planNo);
    }

    @Override
    public List<OtdIfProducePlanVO> findIfListByWeek(String year, String month, String week) {
        return baseMapper.selectIfListByWeek(year, month, week);
    }

    @Override
    public void updateIfPlanBySapBack(String planNo, String sapNo, String sapState, String errorInfo) {
        baseMapper.updateIfPlanBySapBack(planNo, sapNo, sapState, errorInfo);
    }

    @Override
    public Integer findIfNumByWeek(String year, String month, String week) {
        return null;
    }
}
